﻿Imports System.Runtime.CompilerServices
Imports Microsoft.SharePoint
Imports System.Xml

Namespace Extensions
    Module StringExtensions
        'Public Function IsGuid(ByVal value As String) As Boolean
        '    Dim result As Boolean = False
        '    Try
        '        Dim g = New Guid(value)
        '        result = True
        '    Catch ex As Exception
        '    End Try
        '    Return result
        'End Function
        Public Function IsGuid(ByVal expression As Object) As Boolean
            If expression Is Nothing Then Return False
            If TypeOf expression Is Guid Then Return True
            Dim str As String = TryCast(expression, String)
            If str Is Nothing Then Return False
            Try
                Dim g = New Guid(str)
                Return True
            Catch ex As Exception
            End Try
            Return False
        End Function


    End Module
End Namespace